import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    showLoginLayer: false, // 是否显示登陆弹框
    showPayLayer: false // 是否显示支付弹框
  },
  mutations: {
    changeLoginLayerState (state, isShowLogin) {
      state.showLoginLayer = isShowLogin
    },
    changePayLayerState (state, isShowPay) {
      state.showPayLayer = isShowPay
    }
  },
  actions: {
    changeLoginLayerState ({commit}, isShowLogin) {
      commit('changeLoginLayerState', isShowLogin)
    },
    changePayLayerState ({commit}, isShowPay) {
      commit('changePayLayerState', isShowPay)
    }
  },
  modules: {}
})
